package com.thirteen.app.service.impl;

import com.thirteen.app.dao.*;
import com.thirteen.app.dto.SysInforDto;
import com.thirteen.app.service.SysInformationService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service("sysInformationService")
public class SysInformationServiceImpl implements SysInformationService {

    @Resource
    PaperDao paperDao;

    @Resource
    ExamDao examDao;

    @Resource
    QuestionDao questionDao;

    @Resource
    ExamRecordDao examRecordDao;

    @Resource
    QuestionTypeQuestionDao questionTypeQuestionDao;

    @Override
    public SysInforDto querySysInfo() {
        SysInforDto sysInforDto = new SysInforDto();
        sysInforDto.setPaperCount(paperDao.queryPaperCount());
        sysInforDto.setExamCount(examDao.queryExamCount());
        sysInforDto.setQuestionCount(questionDao.queryQuestionCount());
        sysInforDto.setExamRecordCount(examRecordDao.queryExamRecordCount());
        sysInforDto.setAnswerCount(questionTypeQuestionDao.queryQuestionAnsweredCount());
        return sysInforDto;
    }
}
